#include "ParticleGlass.h"

#include "ParticleContext.h"
#include "DescriptorParticle.h"
#//include "StreamBinary.h"

using namespace ParticleEngine; 

const DescriptorParticle ParticleGlass::Descriptor
(
	"Glass", 
	[](ParticleContext& NewContext) { return new ParticleGlass(NewContext); }
); 

ParticleGlass::ParticleGlass(ParticleContext& NewContext) :
ParticleBase(NewContext, &ParticleGlass::Descriptor),
Heat(0.8f)
{
	Adhesions = new PropertyAdhesions(0.03f);
	Adhesions->ParticleCast = this;
}
ParticleGlass::~ParticleGlass()
{
}

void ParticleGlass::Sole()//einzelne aktualisierzung
{
	this->SoleStandard();

	this->Heat.Sole();
}
void ParticleGlass::InteractionIndividual(ParticleBase*const Other, Vec<2, float>& Space, const float& DistanceSquared)
{
	this->InteractionKinetics(Other, Space, DistanceSquared);

	this->Heat.Interaction(Other->HasHeat());
}
ColorRGBA<unsigned char> ParticleGlass::GetColor()
{
	return ColorRGBA<unsigned char> (0, 255, 255, 128);
}

void ParticleGlass::SaveIndividual(std::ofstream& Strm)
{
	Heat.Save(Strm);
}
void ParticleGlass::LoadIndividual(std::ifstream& Strm)
{
	Heat.Load(Strm);
}


